package com.ys.basebindinggdemo.ui.home

import androidx.databinding.ObservableField
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.ys.basebindinggdemo.ui.base.BaseViewModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class HomeViewModel : BaseViewModel() {


//    val _text = ObservableField("Empty")
    val _text = MutableLiveData("Empty")

    fun changeClick() {




    }

    var homeDevicesLD=MutableLiveData(mutableListOf<String>())


    fun homeDeviceGet(){



        viewModelScope.launch(Dispatchers.IO) {


            delay(5000)


            homeDevicesLD.postValue(mutableListOf("1","2","3"))



        }

    }




}